package com.hundsun.fcp.webplugin;

import java.util.EnumMap;

public class FundTradingFunctionConfig {
	private static FundTradingFunctionConfig instance;
	private EnumMap<FundTradingFunction, ConfigItem> mFunctionParamConfigMap;

	private FundTradingFunctionConfig() {
		initFunctionParamConfigMap();
	}

	public static FundTradingFunctionConfig getInstance() {
		if (instance == null) {
			instance = new FundTradingFunctionConfig();
		}

		return instance;
	}

	private void initFunctionParamConfigMap() {
		mFunctionParamConfigMap = new EnumMap<FundTradingFunction, FundTradingFunctionConfig.ConfigItem>(
				FundTradingFunction.class);
		addConfigItem(FundTradingFunction.ASSETS, "assets.html");
		addConfigItem(FundTradingFunction.HELP, "help.html");
		addConfigItem(FundTradingFunction.FEEDBACK, "view-feedback.html");
		addConfigItem(FundTradingFunction.ABOUT, "about.html");
	}

	private void addConfigItem(FundTradingFunction pFunction,String pPageFileName) {
		this.mFunctionParamConfigMap.put(pFunction, new ConfigItem(
				pPageFileName));
	}

	public EnumMap<FundTradingFunction, ConfigItem> getConfigItemMap() {
		return this.mFunctionParamConfigMap;
	}

	public static class ConfigItem {
		public String pageFileName;

		private ConfigItem(String pPageFileName) {
			this.pageFileName = pPageFileName;
		}
	}
}
